//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.carhailing.common.utils;

import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;

@Component
public class MsgUtil {
    public MsgUtil() {
    }

    public String sendMsg(String phone, String code) {
        String result = null;
        String host = "https://dfsns.market.alicloudapi.com";
        String path = "/data/send_sms";
        String method = "POST";
        String appcode = "e90f538637ea401eac9d8e7f03e9522d";
        Map<String, String> headers = new HashMap();
        headers.put("Authorization", "APPCODE " + appcode);
        headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
        Map<String, String> bodys = new HashMap();
        Map<String, String> querys = new HashMap();
        bodys.put("content", "code:1234");
        bodys.put("template_id", "CST_ptdie100");
        bodys.put("phone_number", phone);

        try {
            HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
            result = EntityUtils.toString(response.getEntity());
            System.out.println(result);
        } catch (Exception var12) {
            var12.printStackTrace();
        }

        return result;
    }
}
